home *** CD-ROM | disk | FTP | other *** search
/ Team Palmtops 7 / Palmtops_numero07.iso / WinCE / SDKWindowsCE / HandHeldPCPro30 / sdk.exe / Jupiter SDK / data1.cab / MFC / src / apphelpx.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1999-02-19  |  2.0 KB  |  77 lines

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10.  
  11. #include "stdafx.h"
  12.  
  13. #ifdef AFX_CORE3_SEG
  14. #pragma code_seg(AFX_CORE3_SEG)
  15. #endif
  16.  
  17. #ifdef _DEBUG
  18. #undef THIS_FILE
  19. static char THIS_FILE[] = __FILE__;
  20. #endif
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // Basic Help support (for backward compatibility to MFC 2.0)
  24.  
  25. void CWinApp::OnHelp()  // use context to derive help context
  26. {
  27.     if (m_dwPromptContext != 0)
  28.     {
  29.         // do not call WinHelp when the error is failing to lauch help
  30.         if (m_dwPromptContext != HID_BASE_PROMPT+AFX_IDP_FAILED_TO_LAUNCH_HELP)
  31.             WinHelp(m_dwPromptContext);
  32.         return;
  33.     }
  34.  
  35.     // otherwise, use CWnd::OnHelp implementation
  36.     CWnd* pWnd = AfxGetMainWnd();
  37.     ASSERT_VALID(pWnd);
  38.     if (!pWnd->IsFrameWnd())
  39.         pWnd->OnHelp();
  40.     else
  41.         ((CFrameWnd*)pWnd)->OnHelp();
  42. }
  43.  
  44. #if !defined(_WIN32_WCE)
  45. void CWinApp::OnHelpIndex()
  46. {
  47.     WinHelp(0L, HELP_INDEX);
  48. }
  49.  
  50. void CWinApp::OnHelpFinder()
  51. {
  52.     WinHelp(0L, HELP_FINDER);
  53. }
  54.  
  55. void CWinApp::OnHelpUsing()
  56. {
  57.     WinHelp(0L, HELP_HELPONHELP);
  58. }
  59.  
  60. /////////////////////////////////////////////////////////////////////////////
  61. // Context Help Mode support (backward compatibility to MFC 2.0)
  62.  
  63. void CWinApp::OnContextHelp()
  64. {
  65.     // just use CFrameWnd::OnContextHelp implementation
  66.     m_bHelpMode = HELP_ACTIVE;
  67.     CFrameWnd* pMainWnd = (CFrameWnd*)AfxGetMainWnd();
  68.     ASSERT_VALID(pMainWnd);
  69.     ASSERT_KINDOF(CFrameWnd, pMainWnd);
  70.     pMainWnd->OnContextHelp();
  71.     m_bHelpMode = pMainWnd->m_bHelpMode;
  72.     pMainWnd->PostMessage(WM_KICKIDLE); // trigger idle update
  73. }
  74. #endif // _WIN32_WCE
  75.  
  76. /////////////////////////////////////////////////////////////////////////////
  77.